package cn.com.homeyoda.aimate.aihealth.ui.health.adapter;

import android.content.Context;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.wzq.mvvmsmart.utils.GlideLoadUtils;

import java.util.ArrayList;

import cn.com.homeyoda.aimate.aihealth.R;
import cn.com.homeyoda.aimate.aihealth.bean.RecommendRecipeBean;

public class DietPlanAdapter extends BaseQuickAdapter<RecommendRecipeBean.DataBean.MenuFoodListBean.FoodListBean, BaseViewHolder> {


    public DietPlanAdapter(int layoutResId, @Nullable ArrayList<RecommendRecipeBean.DataBean.MenuFoodListBean.FoodListBean> data, Context context) {
        super(layoutResId, data);
        mContext = context;
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, RecommendRecipeBean.DataBean.MenuFoodListBean.FoodListBean item) {
        GlideLoadUtils.loadImg(helper.getView(R.id.iv_head), item.getIcon(), R.mipmap.ic_member1);
        helper.setText(R.id.tv_food_name, item.getName());
        helper.setText(R.id.tv_calorie, item.getCalorie());
        helper.setText(R.id.tv_weight, item.getWeight());
    }

}
